<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="ColorSB,sketchbook.colors.ColorSB,value,red,green,blue,hue,saturation,brightness,setRGB,setHSB,clone,setGray,toGray,applyColorMatrix,applyColorTransform,valueOf" name="keywords">
<title>sketchbook.colors.ColorSB</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'ColorSB - Sketchbook API Documentation';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Sketchbook</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?sketchbook/colors/ColorSB.html&amp;sketchbook/colors/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;ColorSB</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class ColorSB"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">sketchbook.colors</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class ColorSB</td>
</tr>
</table>
<p></p>
  色情報を表現したクラスです。
  <p>Colorクラスは、RGB,HSBによる色の操作を提供します。<br/>
  このクラスはアルファチャンネルをサポートしません。</p>
  <p>ColorクラスはvalueOfを実装している為インスタンスをuint型に変換することで、色への代入値として使用することができます。</p>
  <p>Colorクラスの内部処理はColorUtilクラスに委譲されています。<br/>
  Colorクラスを用いずに色の操作をう場合、ColorUtilクラスで同様の操作を行うこともできます。</p>
  
  <p>TODO: 色の各要素は遅延評価なのでR,G,B,H,S,Bに対してデータのバインディングができない。速度優先にしてバインディング自体を諦めるか？</p>
  <p>ColorUtilを使うと、brightnessを０とかにすると、必然的にhueやsaturationも０になる。本来のh,sを保存すべきか？</p>
  
  <p></p>
<br>
<span class="label">Example</span>
<br><div class='listing'><pre>
  var col:Color = new Color(0xff0000);
  col.hue = 120;
  
  var bmd:BitmapData = new BitmapData(100,100,false,uint(col)); //Colorインスタンスを直接代入</pre></div>
  
  <p></p>
<p>
<span class="classHeaderTableLabel">See also</span>
</p>
<div class="seeAlso">
<a href="../colors/ColorUtil.html" target="">sketchbook.colors.ColorUtil</a>
</div>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#blue">blue</a> : uint<div class="summaryTableDescription"> 青成分。 0-255 </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#brightness">brightness</a> : Number<div class="summaryTableDescription"> 明度 0-100 </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#green">green</a> : uint<div class="summaryTableDescription"> 緑成分。 0-255 </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#hue">hue</a> : Number<div class="summaryTableDescription"> 色相 0-360 </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#red">red</a> : uint<div class="summaryTableDescription"> 赤成分。 0-255 </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#saturation">saturation</a> : Number<div class="summaryTableDescription"> 彩度 0-100 </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#value">value</a> : uint<div class="summaryTableDescription"> 色を24ビットで表現した数値です </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#ColorSB()">ColorSB</a>(color:uint = 0)</div>
<div class="summaryTableDescription">
   </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#applyColorMatrix()">applyColorMatrix</a>(mat:ColorMatrixFilter):void</div>
<div class="summaryTableDescription">
   現在の色にColorMatrixFilterを適用します。
   
   </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#applyColorTransform()">applyColorTransform</a>(colt:ColorTransform):void</div>
<div class="summaryTableDescription">
   現在の色にColorTransformを適用します。
   
   </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#clone()">clone</a>():<a href="../colors/ColorSB.html">ColorSB</a>
</div>
<div class="summaryTableDescription">
   Color インスタンスの複製を返します。
   
   </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setGray()">setGray</a>(value:Number):void</div>
<div class="summaryTableDescription">
   0-255の値でグレーの色を定義します。
   
   </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setHSB()">setHSB</a>(hue:Number, saturation:Number, brightness:Number):void</div>
<div class="summaryTableDescription">
   色相(hue), 彩度(saturation), 明度(brightnessChanges)から色を定義します。
   
   </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setRGB()">setRGB</a>(r:uint, g:uint, b:uint):void</div>
<div class="summaryTableDescription">
   R,G,Bの3つの値から色を定義します。
   
   </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#toGray()">toGray</a>():void</div>
<div class="summaryTableDescription">
   現在の色をグレースケールに変換します。
   </div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#valueOf()">valueOf</a>():Number</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">ColorSB</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="blue"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">blue</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>blue:uint</code>&nbsp;&nbsp;[read-write]<p> 青成分。 0-255 </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get blue():uint</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set blue(value:uint):void</code>
<br>
</div>
<a name="brightness"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">brightness</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>brightness:Number</code>&nbsp;&nbsp;[read-write]<p> 明度 0-100 </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get brightness():Number</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set brightness(value:Number):void</code>
<br>
</div>
<a name="green"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">green</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>green:uint</code>&nbsp;&nbsp;[read-write]<p> 緑成分。 0-255 </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get green():uint</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set green(value:uint):void</code>
<br>
</div>
<a name="hue"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">hue</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>hue:Number</code>&nbsp;&nbsp;[read-write]<p> 色相 0-360 </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get hue():Number</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set hue(value:Number):void</code>
<br>
</div>
<a name="red"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">red</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>red:uint</code>&nbsp;&nbsp;[read-write]<p> 赤成分。 0-255 </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get red():uint</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set red(value:uint):void</code>
<br>
</div>
<a name="saturation"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">saturation</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>saturation:Number</code>&nbsp;&nbsp;[read-write]<p> 彩度 0-100 </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get saturation():Number</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set saturation(value:Number):void</code>
<br>
</div>
<a name="value"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">value</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>value:uint</code>&nbsp;&nbsp;[read-write]<p> 色を24ビットで表現した数値です </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get value():uint</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set value(value:uint):void</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="ColorSB()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">ColorSB</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function ColorSB(color:uint = 0)</code><p>
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">color</span>:uint</code> (default = <code>0</code>)<code></code> &mdash; 24bit unit value for color. This class does not support alpha channel
   </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="applyColorMatrix()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">applyColorMatrix</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function applyColorMatrix(mat:ColorMatrixFilter):void</code><p>
   現在の色にColorMatrixFilterを適用します。
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">mat</span>:ColorMatrixFilter</code></td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">flash.filters.ColorMatrixFilter</div>
</div>
<a name="applyColorTransform()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">applyColorTransform</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function applyColorTransform(colt:ColorTransform):void</code><p>
   現在の色にColorTransformを適用します。
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">colt</span>:ColorTransform</code></td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">flash.geom.ColorTransform</div>
</div>
<a name="clone()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">clone</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function clone():<a href="../colors/ColorSB.html">ColorSB</a></code><p>
   Color インスタンスの複製を返します。
   
   </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../colors/ColorSB.html">ColorSB</a></code> &mdash; 
                        The copy of the Color instance
   
                        
                     </td>
</tr>
</table>
</div>
<a name="setGray()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setGray</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function setGray(value:Number):void</code><p>
   0-255の値でグレーの色を定義します。
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">value</span>:Number</code> &mdash; 0-255 gray scale.
   </td>
</tr>
</table>
</div>
<a name="setHSB()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setHSB</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function setHSB(hue:Number, saturation:Number, brightness:Number):void</code><p>
   色相(hue), 彩度(saturation), 明度(brightnessChanges)から色を定義します。
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">hue</span>:Number</code> &mdash; 0-360
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">saturation</span>:Number</code> &mdash; 0-100 
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">brightness</span>:Number</code> &mdash; 0-100
   </td>
</tr>
</table>
</div>
<a name="setRGB()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setRGB</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function setRGB(r:uint, g:uint, b:uint):void</code><p>
   R,G,Bの3つの値から色を定義します。
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">r</span>:uint</code> &mdash; 0-255
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">g</span>:uint</code> &mdash; 0-255 
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">b</span>:uint</code> &mdash; 0-255
   </td>
</tr>
</table>
</div>
<a name="toGray()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">toGray</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function toGray():void</code><p>
   現在の色をグレースケールに変換します。
   </p></div>
<a name="valueOf()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">valueOf</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function valueOf():Number</code>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Number</code></td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
